import request from '@/utils/request'

// 查询道闸列表
export function listGate(query) {
  return request({
    url: '/control/gate/list',
    method: 'get',
    params: query
  })
}

// 查询道闸详细
export function getGate(id) {
  return request({
    url: '/control/gate/' + id,
    method: 'get'
  })
}

// 新增道闸
export function addGate(data) {
  return request({
    url: '/control/gate',
    method: 'post',
    data: data
  })
}

// 修改道闸
export function updateGate(data) {
  return request({
    url: '/control/gate',
    method: 'put',
    data: data
  })
}
// 操作道闸
export function controlGate(data) {
  return request({
    url: '/control/gate/control',
    method: 'put',
    data: data
  })
}
// 操作道闸
export function controlGates(data) {
  return request({
    url: '/control/gate/controls',
    method: 'put',
    data: data
  })
}

// 删除道闸
export function delGate(id) {
  return request({
    url: '/control/gate/' + id,
    method: 'delete'
  })
}
